import { User } from '../../user/entities/user.entity';
import {
  Entity,
  PrimaryGeneratedColumn,
  JoinColumn,
  OneToOne,
  Column,
} from 'typeorm';
// import { IsChineseIdCardConstraint } from 'utils/decorators/idCardDecorator';
// console.log('====IsChineseIdCardConstraint');
// console.log(IsChineseIdCardConstraint);
@Entity()
export class IdCard {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  value: string;

  @JoinColumn()
  @OneToOne(() => User, {
    cascade: true,
  })
  userId: number;
}
